#pragma once

#include "Session.h"
#include <boost/asio.hpp>
#include <memory>
#include <unordered_map>
#include <string>

class Session;

class Server
{
public:
	Server(boost::asio::io_context &ioc, short port);
	void cleanSession(std::string uuid);
private:
	void start_accept();
	void handle_accept(std::shared_ptr<Session> new_session, const boost::system::error_code& ec);

	boost::asio::io_context& m_ioc;
	boost::asio::ip::tcp::acceptor m_actor;
	std::unordered_map<std::string, std::shared_ptr<Session>> m_session_map;
};

